#include "main.h"
#include <time.h>

typedef struct
{
    uint8_t hours;
    uint8_t minutes;
    uint8_t secondes;
    uint8_t day;
    uint8_t month;
    uint8_t year;
    uint8_t dst;
} Clock_def_t;

void vTaskCTRL_TIME(void);
void init_HORLOGE(void);

void Time_Adjust();

void Time_Show(void);

void Time_Display(uint32_t TimeVar);

/**
 * @brief  Configures the RTC.
 * @param  None
 * @retval None
 */
void RTC_Configuration(void);
uint8_t USART_Scanf(uint32_t value);
void decodeDateTime(time_t datetime, struct tm *t);
time_t encodeDateTime(struct tm *t);

/**
 * @brief Retourne l'heure courante sous forme de string
 */
void getTime(char *str);
uint8_t getHour(void);
uint8_t getMin(void);
uint8_t getSec(void);
uint8_t getDayLightSaving(void);

/**
 * @brief Get hours in second
 */
uint32_t CLOCK_getHoursInSecond(void);

/**
 * nb day since January 1
 */
uint16_t getDaySinceYearStart(void);

/**
 * get month
 */
uint16_t getMonth(void);

/**
 * Set current hours
 */
void RTC_SetHours(uint8_t hours);
